package com.greedy.user.controller;

import com.greedy.user.pojo.User;
import com.greedy.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Greedy
 * @Date: Created in:2022-07-19 15:57
 * Description:
 */
@RestController
@RequestMapping("user/")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 根据ID查询收件人所有的信息
     *
     * @param id
     * @return
     */
    @GetMapping("{userId}")
    public User getUserById(@PathVariable("userId") Long id) {
        return userService.getUserById(id);
    }

}
